package com.gnerv.sylvanas.business.manage.storage;

import com.gnerv.sylvanas.business.manage.model.dto.RouteDTO;
import com.gnerv.sylvanas.business.manage.model.dto.RouteTreeDTO;
import com.gnerv.sylvanas.business.manage.model.entity.Route;
import com.gnerv.sylvanas.business.manage.repository.mapper.RouteMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Gnerv LiGen
 */
@Slf4j
@Service
@AllArgsConstructor
public class RouteStorageService {

    private final RouteMapper routeMapper;

    
    public int insert(Route route) {
        return routeMapper.insert(route);
    }

    
    public int deleteByUkId(String ukId) {
        return routeMapper.deleteByUkId(ukId);
    }

    
    public int updateByUkId(Route route) {
        return routeMapper.updateByUkId(route);
    }

    
    public RouteDTO selectByUkId(String ukId) {
        return routeMapper.selectByUkId(ukId);
    }

    
    public List<RouteDTO> selectListByName(String name) {
        return routeMapper.selectListByName(name);
    }

    
    public List<RouteDTO> selectListByParentUkId(String parentUkId) {
        return routeMapper.selectListByParentUkId(parentUkId);
    }

    
    public List<RouteTreeDTO> selectListTreeByParentUkId(String parentUkId) {
        return routeMapper.selectListTreeByParentUkId(parentUkId);
    }

}
